//
//  APIHeartRateImp+OTA.swift
//  APIHeartRate
//
//  Created by Tek on 2023/3/13.
//

import Foundation
import CoreBluetooth


extension APIHeartRateImp: HROTADelegate{
    func sendNext(data: Data) {
        writeOTAData(data)
    }
    
    func readOtaChar() {
        readOTAData()
    }
    
    func otaError(_ error: OtaError) {
        observers.forEach({ _, delegateApi in
            delegateApi.bleOtaError(error: error)})
    }
    
    func otaLog(_ status: OtaStatus, _ progress: Float) {
        observers.forEach({ _, delegateApi in
            delegateApi.bleOtaStauts(status: status, progress: progress)})
    }
}
